package com.lnking.lnkingplace.mapper;

import com.lnking.lnkingplace.model.dto.isolation.personnel.PersonnelWordDto;
import com.lnking.lnkingplace.model.entity.IsolationPersonnel;
import com.lnking.lnkingplace.model.request.isolation.personnel.PersonnelUpdateMoveStatus;
import com.lnking.starter.mybatis.mapper.CustomBaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zhangqt
 * @since 2022-08-27
 */
public interface IsolationPersonnelMapper extends CustomBaseMapper<IsolationPersonnel> {

    PersonnelWordDto getWordData(String id);

    @Update(" update isolation_personnel set move_status = #{moveStatus},end_date = #{endDate} " +
            "where id = #{id}")
    void updateStatus(PersonnelUpdateMoveStatus params);

    @Select("select * from isolation_personnel where del_flag = 0 and union_flag = #{id}")
    List<IsolationPersonnel> getFamily(String id);
}
